package com.weimob.cloud.api.shop.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * 微盟订单状态
 */
@RequiredArgsConstructor
@Getter
public enum WeimobShopOrderStatusEnum implements Serializable {

    /**
     * 创建
     */
    CREATE(0),

    /**
     * 部分支付
     */
    PARTIAL_PAID(1),

    /**
     * 已支付
     */
    PAID(2),

    /**
     * 待发货
     */
    WAIT_DELIVER(3),

    /**
     * 部分发货
     */
    PARTIAL_DELIVER(4),

    /**
     * 已发货
     */
    DELIVERED(5),

    /**
     * 确认收货
     */
    CONFIRM_RECEIVED(7),

    /**
     * 完成
     */
    COMPLETED(8),

    /**
     * 取消
     */
    CANCEL(9),
    ;

    private final int code;

    // 有效订单状态
    public static final List<Integer> EFFECT_ORDER_STATUS = Arrays.asList(
            WeimobShopOrderStatusEnum.PAID.getCode(),
            WeimobShopOrderStatusEnum.WAIT_DELIVER.getCode(),
            WeimobShopOrderStatusEnum.PARTIAL_DELIVER.getCode(),
            WeimobShopOrderStatusEnum.DELIVERED.getCode(),
            WeimobShopOrderStatusEnum.CONFIRM_RECEIVED.getCode(),
            WeimobShopOrderStatusEnum.COMPLETED.getCode()
    );
}
